import { defineStore } from 'pinia'
import { ref } from 'vue'

/**
 * @deprecated 此store已被弃用，请使用useWordHighlight组合式API
 * 单词状态管理已移至src/composables/useWordHighlight.js
 * 
 * 单词状态、高亮和API交互现在直接通过useWordHighlight和API直接处理
 * 不再使用本地存储
 */
export const useWordMemoryStore = defineStore('wordMemory', () => {
  // 单词状态常量 - 保持与useWordHighlight一致
  const WORD_STATUS = {
    NORMAL: 0,   // 普通词汇，无高亮（灰色）
    KNOWN: 1,    // 认识（绿色）
    FUZZY: 2,    // 模糊（黄色）
    UNKNOWN: 3   // 不认识（红色）
  }
  
  // 返回空的实现，以防有组件仍在使用此store
  return {
    WORD_STATUS,
    setCurrentArticleId: () => {},
    setCurrentCourseId: () => {},
    linkArticleToCourse: () => {},
    getArticleCourseId: () => null,
    saveCourseWordDetails: () => {},
    updateWordStatus: () => {},
    getWordStatus: () => WORD_STATUS.NORMAL,
    cycleWordStatus: () => WORD_STATUS.NORMAL,
    getWordClass: () => '',
    getCourseWordList: () => [],
    getArticleWordList: () => [],
    mergeWordStatuses: (wordList) => wordList,
    getAllWordStatuses: () => [],
    currentWordMemory: ref([]),
    currentCourseWords: ref([])
  }
}) 